UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7QdDx8gK2zaZLaf08tppyY1ErpgJDDrsSCF04V5gTro='
WHERE
key_id = 'f70409ec622e49a58930fd7305661a71546f5646811e76bc8b9557217c9e0331'
AND (
token = '7QdDx8gK2zaZLaf08tppyY1ErpgJDDrsSCF04V5gTro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)