UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZMW2nHJrrBBG3k+lMUlP2xr26vcIxl98e5Tivek/iWk='
WHERE
key_id = 'b4069d3ef8d54a6ac411ef715756ce945a1bf83102c5175e57da939fb097a80d'
AND (
token = 'ZMW2nHJrrBBG3k+lMUlP2xr26vcIxl98e5Tivek/iWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)