UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Wqt0uP/yw4jCo7qJSNGfcALCSZtwz8L3Mm8WK2vE1g='
WHERE
key_id = '02a8d7caeaee921f9c8fe060013d09ce2b34a53ebffb9d3ab785ec646fd427f2'
AND (
token = '/Wqt0uP/yw4jCo7qJSNGfcALCSZtwz8L3Mm8WK2vE1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)