UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yIEuD6lm8yBbmigOo7g0pHxM7mXGIdq/C9zZKMRtWUY=' 
WHERE 
  key_id = '108f4f29d51c6ac0f64ad391e18a4fbbe166208097b53bfb042f994593193322' 
  AND (
    token = 'yIEuD6lm8yBbmigOo7g0pHxM7mXGIdq/C9zZKMRtWUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033