UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CXoOVKw2ZtFVwqLXDA5ZTqPUrNCczznd5JLG858UJfk=' 
WHERE 
  key_id = '68270ffcde76f13d618013f6942fd73e2adf47798b3662d716777022848411a3' 
  AND (
    token = 'CXoOVKw2ZtFVwqLXDA5ZTqPUrNCczznd5JLG858UJfk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029