UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qB/1JP8EFaSLeZEucdSowt2G83fdWJJzmqPKvEhQneI='
WHERE
key_id = '88db8d245d16999cd6701dc69b48b1d47c770c2017972f8bacc991ca9e280ef7'
AND (
token = 'qB/1JP8EFaSLeZEucdSowt2G83fdWJJzmqPKvEhQneI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)