UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yHY+3CjRylDhbEnqqfDKHMybLEmRVYXCuuYWBBp3DUw=' 
WHERE 
  key_id = '40d88ab1abce1e67e91bfbc6bc02551a9a70d920797cf76dd60e37cff56898ff' 
  AND (
    token = 'yHY+3CjRylDhbEnqqfDKHMybLEmRVYXCuuYWBBp3DUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026