UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AieQwhoVDLn9SwHsGy0MtG3tHM2HxnZRuG4+j57KNz8='
WHERE
key_id = '79dbf21b2defe5d7e906a97a17201e499a6c8a9c55a420064948b1130e85a85e'
AND (
token = 'AieQwhoVDLn9SwHsGy0MtG3tHM2HxnZRuG4+j57KNz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)