UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jVMy6LiUhOaNbVMZfj5c27p9MSCLwa/XLoTlQVJiOzM=' 
WHERE 
  key_id = '142e6ff5877603e12eed36a61968b5e35148e0673b81b2a2626c0854bb8f4e65' 
  AND (
    token = 'jVMy6LiUhOaNbVMZfj5c27p9MSCLwa/XLoTlQVJiOzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030