UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CPjerDToFP6FzhM9RY7YNLSLQeNQjCO6K1c1FafGeFI=' 
WHERE 
  key_id = 'ca68c0b92755dc82a767f40c4013590f22df6a7ae9c115fa1b39577b9b8b5d42' 
  AND (
    token = 'CPjerDToFP6FzhM9RY7YNLSLQeNQjCO6K1c1FafGeFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050