UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NQ/Gga+dI81OqV820NpMOClLWpAE0IWDPoWKbGDCNp4=' 
WHERE 
  key_id = '88118cb08c8810d8767ed1af43bd9e44e5d0d1671e782eb693638a37e7d69a9f' 
  AND (
    token = 'NQ/Gga+dI81OqV820NpMOClLWpAE0IWDPoWKbGDCNp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025