UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8GTTX7gjKMJfcs2XztfntJcAPPxuwFzK+46/M/Fn9fo='
WHERE
key_id = '4ce7d5b9b4f3f7c78d94c7b608760b2d5ba320e15c3f122be4d31fa26c039533'
AND (
token = '8GTTX7gjKMJfcs2XztfntJcAPPxuwFzK+46/M/Fn9fo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)