UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LsdDxpQhf4j1cPX1yV1wnDXeieUjW52xsSJM0ed0HmU=' 
WHERE 
  key_id = '89cc42666ed8c4575e5c89b4f062beb2cfc3ecfccb6847e830592a13882371a9' 
  AND (
    token = 'LsdDxpQhf4j1cPX1yV1wnDXeieUjW52xsSJM0ed0HmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033