UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l9Kjy/uT8nOSh/kEYVHdDH5j89VMLJP35qhyQtJwE6I='
WHERE
key_id = 'a67c02315dd005dae1c1224a1e304b605670278469bb3aae34d13d71778267e3'
AND (
token = 'l9Kjy/uT8nOSh/kEYVHdDH5j89VMLJP35qhyQtJwE6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)