UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zV5rTwaDJ51S1gtaz/PUPMTej4SDgemdzerRd2tIWl4='
WHERE
key_id = 'eceb9b7658e8b15bf642134806877cb79ef5d3516921329f336d122afeeaef93'
AND (
token = 'zV5rTwaDJ51S1gtaz/PUPMTej4SDgemdzerRd2tIWl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)