UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vjtOE/kvvBHTNZnyxUzJnzyJQa6IALO/lDQ1WGueKQc='
WHERE
key_id = 'dcd2f9daa216e88d6701165f874abba7556dcd332f7e5a81b5f911f467241fd5'
AND (
token = 'vjtOE/kvvBHTNZnyxUzJnzyJQa6IALO/lDQ1WGueKQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)