UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bw1DfAr9hRHwx3WBcVR/emu9DpqMaPG2plt6XkHiA4c='
WHERE
key_id = 'a69ac3a91e1c40aad6aba19d3f5fa953b90adaf4f47abb9fd6a413f7bf51826d'
AND (
token = 'bw1DfAr9hRHwx3WBcVR/emu9DpqMaPG2plt6XkHiA4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)