UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '67X5ZsOqALIRoyZAHQhW61cXXslICT96OhthKHNGVEY='
WHERE
key_id = '2b90601f0d1e1b9431b91b8fec4f14fc7b417fcd585f50b686e920a6053dec1c'
AND (
token = '67X5ZsOqALIRoyZAHQhW61cXXslICT96OhthKHNGVEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)