UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HC4osuyQJdNc7omR8yCeAZ8zPe6xhGQf0doQ7AYT9KM=' 
WHERE 
  key_id = '7e5d74e2336d2ce5c4fa2d0e49673d1fe7d988c7caf105cdf408762bbcf453b0' 
  AND (
    token = 'HC4osuyQJdNc7omR8yCeAZ8zPe6xhGQf0doQ7AYT9KM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020