UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wyOyWkhhCud1gBCZkV6cOHwSOedaQ4RGS7FPGFTpuV4=' 
WHERE 
  key_id = '2a8eed0fefb6dbc852a4571e6cf04b9e8342f2e4399cefcaa7385950b09d386a' 
  AND (
    token = 'wyOyWkhhCud1gBCZkV6cOHwSOedaQ4RGS7FPGFTpuV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017