UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gKzMX4/8YYbYHBf1gGjOTVurJsUUG2L9SG2WF2O2IRw='
WHERE
key_id = 'a4b1e2f41d78d0e62d2aec1641bf57179cf30bc3b3e03e3969d93e102969e573'
AND (
token = 'gKzMX4/8YYbYHBf1gGjOTVurJsUUG2L9SG2WF2O2IRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)