UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1W/t8dHogeWrCtEdnAHfFT7JwQ6fPT9nYKvsLSkw3UY='
WHERE
key_id = 'ec50bdebf37222e41abb170cdfc9c279b37200f7db0f577a16fab4437e925f61'
AND (
token = '1W/t8dHogeWrCtEdnAHfFT7JwQ6fPT9nYKvsLSkw3UY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)