UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7FvnPuqA+lklU+IsjpeMk0vcuSUEVp2e8ozFwMtuMgI=' 
WHERE 
  key_id = '6d559b7ae9705dc04a9c95bb122c177e6a7f156572bb2bfd2353ece13e7413fa' 
  AND (
    token = '7FvnPuqA+lklU+IsjpeMk0vcuSUEVp2e8ozFwMtuMgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027