UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gz4BXgNwO74DeNN0wv5GNgNdApz36puw1odGRkpJOhU=' 
WHERE 
  key_id = '2ee98d1de426e72c491a80c1a5e7dbaa14e8e760dfc0515f1d907488e8557f98' 
  AND (
    token = 'Gz4BXgNwO74DeNN0wv5GNgNdApz36puw1odGRkpJOhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020