UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f4jw2Q78Jnkr/7o7quMy2WA+dbnt0G5z5sPx1AEdXwM=' 
WHERE 
  key_id = '9e9bc97d71ae3064f83191e0afc8d2e41834e7d178edd0cb1b0b515e7900bf08' 
  AND (
    token = 'f4jw2Q78Jnkr/7o7quMy2WA+dbnt0G5z5sPx1AEdXwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031