UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xsf5JNT1d3KAmyVn0Ede5u0Vh8qMDhrb9k0/UxvhkFI=' 
WHERE 
  key_id = 'a50e6320fca386c99a5bf9edd4ea151ed447fb15e5b37292050e5b73ad6108a5' 
  AND (
    token = 'xsf5JNT1d3KAmyVn0Ede5u0Vh8qMDhrb9k0/UxvhkFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00129