UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ef9AjF9heR0TVckxZtKCWFBQLfcahgbfcHD2UhNrKVY=' 
WHERE 
  key_id = '1b222e13660cbb1c12f7aa9ebdacfdc99a01cb5671bc48f4b4600764f548946e' 
  AND (
    token = 'Ef9AjF9heR0TVckxZtKCWFBQLfcahgbfcHD2UhNrKVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034