UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BsLtsTrijoL/3zvFyOLRqIep40mmlnOPlCu2bs/QmFM='
WHERE
key_id = '326024df4583a2f3e6d44aaaad9e50be9388162e415485ef67d0ceb516fb3c8e'
AND (
token = 'BsLtsTrijoL/3zvFyOLRqIep40mmlnOPlCu2bs/QmFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)