UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VcBl2dLPZXevIvtZkP8NPvJksofc6s0d+F1Nao2Cvf0=' 
WHERE 
  key_id = '39da6ec496ec86a11d9664e3573c324ebc292ac7ee1d25d6aa107164f11ac1da' 
  AND (
    token = 'VcBl2dLPZXevIvtZkP8NPvJksofc6s0d+F1Nao2Cvf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035