UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+4BOkb94IjHTYv4omAnzX+65dApdf7EN8imhBsf0vsM=' 
WHERE 
  key_id = 'd5803b8e494dbfc202591cf3d38a39ffd35037d4c2e5997883b6a33ece36fe23' 
  AND (
    token = '+4BOkb94IjHTYv4omAnzX+65dApdf7EN8imhBsf0vsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060