UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jliE2DFuFwgIQfh0/o3oGrRXFVe0JA1lEt6pcz6SsLk=' 
WHERE 
  key_id = '925b67bbb26651b596b45ab49fb0c7a9265634a2d95f9636e9c2aa69c0e4a7b9' 
  AND (
    token = 'jliE2DFuFwgIQfh0/o3oGrRXFVe0JA1lEt6pcz6SsLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034