UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vv7S32JdoW3YgJLzTCNglz1vT02b+7mze9uabvXT7fg=' 
WHERE 
  key_id = '68361eb1d6d873ec0aefe63a9941bf6c2a57937957357a3593531c2f645b6032' 
  AND (
    token = 'Vv7S32JdoW3YgJLzTCNglz1vT02b+7mze9uabvXT7fg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017