UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fBJclxqIGWJCG1puuuvFxnsL0de8C0Y4nsqNpAxfu00=' 
WHERE 
  key_id = '6fec15e6e29145a44c53e0d34e0c63aca1ffb9e3b8c724df97fd92e9a10e959b' 
  AND (
    token = 'fBJclxqIGWJCG1puuuvFxnsL0de8C0Y4nsqNpAxfu00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033