UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BUGlGHXPO2gPeF2OkH2RQZqmBba9xUgv/GM8qChLKbk='
WHERE
key_id = '35992c916a9452f394f78c70f1b0e6a0b8d3e228946766a29091736eb980395b'
AND (
token = 'BUGlGHXPO2gPeF2OkH2RQZqmBba9xUgv/GM8qChLKbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)