UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8p3eXZsz4pgFt3Xm45mL7FtIBYf++M/oOoCbNTFZvM='
WHERE
key_id = '39b1f86eb0c322b0240387729b1e1d116cac72f246dbfeb761193bbb37fc84ba'
AND (
token = '+8p3eXZsz4pgFt3Xm45mL7FtIBYf++M/oOoCbNTFZvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)