UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0jXidEkm1KvwyPHaPWtXNtpt+V3iZpVFbLSdRFZotV0=' 
WHERE 
  key_id = '63dfc8867b3ad082574e1dc972e6dd729801c48fcdfb7a1e51558408a3a43fe4' 
  AND (
    token = '0jXidEkm1KvwyPHaPWtXNtpt+V3iZpVFbLSdRFZotV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043