UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SiKEdaktE2xcG1t6iZRanBwOC2jqWIt+sXxLGsOdMbk=' 
WHERE 
  key_id = '38d43de37af1bd8c4313b98202fc7ef59f81bec7b0ee2e3568766e745f5743b6' 
  AND (
    token = 'SiKEdaktE2xcG1t6iZRanBwOC2jqWIt+sXxLGsOdMbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023