UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'efes1raeCj+8wMyWW3BUIqpenvoEw3VsWwU6ggDUQME=' 
WHERE 
  key_id = '274c41745ba8947f303537382f95709297851ca5e13dbc30d16ebda39742e8b0' 
  AND (
    token = 'efes1raeCj+8wMyWW3BUIqpenvoEw3VsWwU6ggDUQME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027