UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XBWhH1qzQsvSNtD0xNEjkqMdAseWkohX5fuFMDN0kuM='
WHERE
key_id = 'b6c62e39956ed93d4024d53f0f2615c314d127aceb8c25da2ded101420dc68d3'
AND (
token = 'XBWhH1qzQsvSNtD0xNEjkqMdAseWkohX5fuFMDN0kuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)