UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eXVN0My6JKyWvVjtepxdMY/Hz9rZqM6lBOzV8K30hQA='
WHERE
key_id = '6014e6007e0a4e4431897570d83044c108a859e4d6e334bfbf98e41eda75c393'
AND (
token = 'eXVN0My6JKyWvVjtepxdMY/Hz9rZqM6lBOzV8K30hQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)