UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kyVkucz+VQ2a5ZZEAB/lx8OB3JRJrhOWpbmpf2ATlRc=' 
WHERE 
  key_id = 'cb179a37cea2dcb2e31194795f33f4119b034d7edcf7a52177df56f8095ad4aa' 
  AND (
    token = 'kyVkucz+VQ2a5ZZEAB/lx8OB3JRJrhOWpbmpf2ATlRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020