UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MSPO9wz5eaiwaDq+lmZ4mBvhMofBhfMe5OPxudu8CyI='
WHERE
key_id = 'ee4879fddfc235980e269457dd7475a3ef5827aef7a4ff5c4d944e06f90e20f4'
AND (
token = 'MSPO9wz5eaiwaDq+lmZ4mBvhMofBhfMe5OPxudu8CyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)