UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jfYyQhS35GHXZmNrKFOE09zPQSFcHRHbXjUu73EMNrc='
WHERE
key_id = '50dd9ec33a809b2a49f1b75bc30690a18e908cb2f0a524b50f786b4493319b34'
AND (
token = 'jfYyQhS35GHXZmNrKFOE09zPQSFcHRHbXjUu73EMNrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)