UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oaQp//qqgr8Z0nossX4ubNj9opXP8OXECZjEoRJrw3I=' 
WHERE 
  key_id = 'c68639dd8bd0332691fe0458d8be2c500c6145e02596b28dbad3ccab28becba4' 
  AND (
    token = 'oaQp//qqgr8Z0nossX4ubNj9opXP8OXECZjEoRJrw3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029