UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lKLBlrjjWiO1sLhSRz0a/G0YQjNrOkYQ9js4slGKLDo='
WHERE
key_id = '853d26345bfc92da6d8b1cc3d9acee5508a19883e69aa88740bda50110159f61'
AND (
token = 'lKLBlrjjWiO1sLhSRz0a/G0YQjNrOkYQ9js4slGKLDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)