UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'htrnk+m2t/t0I32qagHSsysNfAE9biZyQGVrCGn3h9k='
WHERE
key_id = '72d3a104e9a03580fbf9f13b47dc2556109ad8f796642703b475f63e3c58da9c'
AND (
token = 'htrnk+m2t/t0I32qagHSsysNfAE9biZyQGVrCGn3h9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)