UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r9vz1wonB8Njvlbwb5SXw5sv/1K1/yMg/hxljP1qHuM=' 
WHERE 
  key_id = '72fb45808adf394bc322a6478ddf8ccbe8ffed6a5a2cb4e77f7ec53a26ae109d' 
  AND (
    token = 'r9vz1wonB8Njvlbwb5SXw5sv/1K1/yMg/hxljP1qHuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034