UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '07rAShEbs/7HpCqJbf0/zDeHQdaTEai+3uJUB4ZXU04=' 
WHERE 
  key_id = 'd96475a04c8666a6bb8bd9045deb28a126818d31725a0e01a724c7b09cd355ab' 
  AND (
    token = '07rAShEbs/7HpCqJbf0/zDeHQdaTEai+3uJUB4ZXU04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029