UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bpyvIimCIOohR3Buz/Jr6DO7axZZcRn5LXg9tdgJsik=' 
WHERE 
  key_id = '109d02e582f4baea38bd066436fff47d137f0fae32a2e75979bcbafde78a0b6b' 
  AND (
    token = 'bpyvIimCIOohR3Buz/Jr6DO7axZZcRn5LXg9tdgJsik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054