UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RGmhhkd/Entr0CNUKPqKqIv3G5FC1M2BWKVl5OlhB7U=' 
WHERE 
  key_id = 'ec4abdbe644f11c0f1473c5ad0e1de84ab06f83334fd0d2c4a7759f9d37984ae' 
  AND (
    token = 'RGmhhkd/Entr0CNUKPqKqIv3G5FC1M2BWKVl5OlhB7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045