UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l25ff5Njuyo7DYQ4QQKNex0geZ+QQiU+ZpVqyZrDHXk='
WHERE
key_id = '957e9edb6fcaff3224f5e162231030c3c9e4d489a95af8b814bc97dbe743a758'
AND (
token = 'l25ff5Njuyo7DYQ4QQKNex0geZ+QQiU+ZpVqyZrDHXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)