UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qOZxEU1aRPRhUzA884+XL7icbZckgg8jylbxVK5fcpM=' 
WHERE 
  key_id = '6d75bebe2a6ee85fadc4252ad44ef60d21a181ffee5c624d184cf4a968d716ae' 
  AND (
    token = 'qOZxEU1aRPRhUzA884+XL7icbZckgg8jylbxVK5fcpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025