UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sitpmuGbOUlYgSvsdl5TVxMiBCzQ6DtQBCvYoGiaavM=' 
WHERE 
  key_id = '8d3f46b941fa2e5d5da01f469552aea1866ba116e843ff79b777bbeecac08e78' 
  AND (
    token = 'sitpmuGbOUlYgSvsdl5TVxMiBCzQ6DtQBCvYoGiaavM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019