UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SakT9FDinYv1M6aFxL+4oOId0fDWipBdifLn+tktu9A=' 
WHERE 
  key_id = '598ba5d7776b030d1891c60ffe11309b0abceb98b09cfa1b1bf8d07a6b27ac95' 
  AND (
    token = 'SakT9FDinYv1M6aFxL+4oOId0fDWipBdifLn+tktu9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033