UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xdHBlBX/CGDWsYnQNvn1efJUYdJqlG2O2sEwLBa8bDs='
WHERE
key_id = '839ef40660fea21747d39f43ce7a102aae50146fd52f1eb019dbbcc411a781ce'
AND (
token = 'xdHBlBX/CGDWsYnQNvn1efJUYdJqlG2O2sEwLBa8bDs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)