UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A84nOUBCBSaNjExYqjOrYYREXXwTrLCQV23WrwtcNG0='
WHERE
key_id = '9cbd612ca13f9426e142f69fd825d2e303206ad61f4d338e9aade0568fce96d2'
AND (
token = 'A84nOUBCBSaNjExYqjOrYYREXXwTrLCQV23WrwtcNG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)