UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'htfiS5GBjcZyn5+RLkr/l7gGzVUy19eIk143lpYEdCE='
WHERE
key_id = '764e7a6933338073dec82ff2d45ef6ccad086a7963c28c7d7c795cb74bbf2c41'
AND (
token = 'htfiS5GBjcZyn5+RLkr/l7gGzVUy19eIk143lpYEdCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)