UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CkllIhQwbT7xzHPO1MPfcUY9V4XS2p3dChBQxe488Rg=' 
WHERE 
  key_id = '86736d12c78cce6e1c5e16167ba59be697739e8e01a461b293247ae9311a8dec' 
  AND (
    token = 'CkllIhQwbT7xzHPO1MPfcUY9V4XS2p3dChBQxe488Rg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045