UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ITXZwXrpc/VZiSiI7DffOi8Ht5PVXw8o4/JOqfBDOvI='
WHERE
key_id = '331fe87fac726d469c13377b68f739b3847b99f96b03b7195a00640bdc3322ad'
AND (
token = 'ITXZwXrpc/VZiSiI7DffOi8Ht5PVXw8o4/JOqfBDOvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)