UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oQCIiPrC/Umz20gVaP4UOzahl9d0xmaprlEK7DxSp4o=' 
WHERE 
  key_id = 'b6439b6e6914299f7ce57121108ba182bccd6e8e978dde12f35ab9a0e69bf56a' 
  AND (
    token = 'oQCIiPrC/Umz20gVaP4UOzahl9d0xmaprlEK7DxSp4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041