UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gQALYoN/X81LX1TlWQjm3u5wwfiGH1T2Z0OTH5dHxMc=' 
WHERE 
  key_id = 'bc3ff73b5bf7bad0ba3facabc26b98d4494b6f537beb2b6f73047042353dd8db' 
  AND (
    token = 'gQALYoN/X81LX1TlWQjm3u5wwfiGH1T2Z0OTH5dHxMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016