UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'biQNVQ5VZLM+yiIO2thzx0QA0QB3i+Xdlz8y/nQTTEs='
WHERE
key_id = 'f7a5036cce2b79cd607e8de39d193ae52240cd8cca8c0283be1740b14331537c'
AND (
token = 'biQNVQ5VZLM+yiIO2thzx0QA0QB3i+Xdlz8y/nQTTEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)