UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gg0UwkEK7esgwdluZv/qNDmWS7kHIKZF7f0IrXaW4dE=' 
WHERE 
  key_id = '9f0da88a8061780dfebf43a4623dafa751734fa8f1daad0f1a1663e27fe4a304' 
  AND (
    token = 'gg0UwkEK7esgwdluZv/qNDmWS7kHIKZF7f0IrXaW4dE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054