UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rWYPjHGPXfQjQw283l8BIqzL6KxpKEwoE8UIxdgEE4U=' 
WHERE 
  key_id = 'c91d56000ce867aae9d9c37c2156afd4fc89549e7607edd779fc7f3ff88572e6' 
  AND (
    token = 'rWYPjHGPXfQjQw283l8BIqzL6KxpKEwoE8UIxdgEE4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028