UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nJPKuh/QWeGSHBmCAgzXxuWa6y4XB4098zMxjtPJFy8=' 
WHERE 
  key_id = '6d60ef5ae11cf9309ac4fdabed3dc1781f9c394fb4746b10de36601ffacb8972' 
  AND (
    token = 'nJPKuh/QWeGSHBmCAgzXxuWa6y4XB4098zMxjtPJFy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026