UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UldHjIJcw28w2/qcsROQq1mOU6mxGijZ3fd8QzNmfSA='
WHERE
key_id = '7bc1aa6a7e73a728f52182396cf497d497eb3f13f182fa7ec937072f1073f016'
AND (
token = 'UldHjIJcw28w2/qcsROQq1mOU6mxGijZ3fd8QzNmfSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)