UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'shQ5d+Nodh5KLv58QB7SUkCWhfb9CF3guLIOe+yFlJQ=' 
WHERE 
  key_id = 'f65435e5d680d5a4ceb7170e9d3ab50bda8c47532d7bf0cfadf91b96f19bd995' 
  AND (
    token = 'shQ5d+Nodh5KLv58QB7SUkCWhfb9CF3guLIOe+yFlJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051