UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'spvpV3Sx3MJCXaLUSRMkI+wzS/1I5hUr9WYh4oFMQn4=' 
WHERE 
  key_id = '7a72732bfaf8ce9a84f0eda241cd996df69cd0ff6c89415e246f98a7a489aec1' 
  AND (
    token = 'spvpV3Sx3MJCXaLUSRMkI+wzS/1I5hUr9WYh4oFMQn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031