UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32holuNG+VuBSgxCXQB5ieQeNjDSKLYWjfZ3bNdoCWU='
WHERE
key_id = '4b4679afc4e3395d60f2811d276fe19e1e99f2190b64bdf94e2f8fbe2f48cf14'
AND (
token = '32holuNG+VuBSgxCXQB5ieQeNjDSKLYWjfZ3bNdoCWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)