UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xgMhJflUvwgTkMBT4KzJ7h98rVMWGOBC1/Bv3GdXcgw=' 
WHERE 
  key_id = '954aa7f7d89deb1cc3dd7afe9a92d7f81d99a4ceb280afefcda4e60e9183217d' 
  AND (
    token = 'xgMhJflUvwgTkMBT4KzJ7h98rVMWGOBC1/Bv3GdXcgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020