UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TQHABEvtLKciJaVm2bIyYpvXBgn+n7LCOGvf/oaDNF8=' 
WHERE 
  key_id = '2463536d20fd81eae60139b951e65c27f3f206d95e5a801d21719f4d0d66d176' 
  AND (
    token = 'TQHABEvtLKciJaVm2bIyYpvXBgn+n7LCOGvf/oaDNF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028