UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WvjK6FahBIBgIrcDXPBB4w/ycJdnzvBVMA+1LflNE9I=' 
WHERE 
  key_id = '66d4d071e0da92f080b4641df947bb05722a87ac0c5838e2a6d7a55648cb99ef' 
  AND (
    token = 'WvjK6FahBIBgIrcDXPBB4w/ycJdnzvBVMA+1LflNE9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035