UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P8NFnsxia0jy/kNwgsdiIzQnU9FSg+crOQxxOFAgnxo=' 
WHERE 
  key_id = '085d49c05bdf6facb22ff2c4cbeb4c2aa7b7b13fa212abf64bd63d52d7e0d522' 
  AND (
    token = 'P8NFnsxia0jy/kNwgsdiIzQnU9FSg+crOQxxOFAgnxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035