UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MmOQlum08jQjHhpENiBBXHow5k76YF0ZWZmk/DJytrY=' 
WHERE 
  key_id = '189af42934d9e1016f766ab0b6c97654036962ed9c71f644c06a7984bc2c0c37' 
  AND (
    token = 'MmOQlum08jQjHhpENiBBXHow5k76YF0ZWZmk/DJytrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030