UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XJSIGHuoT2TThltSeKKkRPFpeb7wJ4Bpk6teTcZa8cg='
WHERE
key_id = '063e14cf2dfdbcb63f490830b75b8be7cc18b72741b794419f1c0e0487841efc'
AND (
token = 'XJSIGHuoT2TThltSeKKkRPFpeb7wJ4Bpk6teTcZa8cg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)