UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wmThcXoJ667w79JGxI18PI3XcqDzLtfpVsHodhBHw1k=' 
WHERE 
  key_id = '3b3cdda4b6d7e2b1ea8b0def2958873e5f4442e20b2fd127adaa35e360e66078' 
  AND (
    token = 'wmThcXoJ667w79JGxI18PI3XcqDzLtfpVsHodhBHw1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020