UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VWa0f32zMe81j4AbdG1+npVI+0oxfS14UcDE8F6vK3c=' 
WHERE 
  key_id = '89fe3be7220d36ffa68f2e9523d2c5cdf53fa360ead77066eaea950d7953ee7d' 
  AND (
    token = 'VWa0f32zMe81j4AbdG1+npVI+0oxfS14UcDE8F6vK3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048