UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yRX3v/un40wRvPYNhGh1A/l8jAXT+a27g0NbBtIpGrA='
WHERE
key_id = 'ba97a4f73980ba831b968e0a11f1723126158493601ded412dca00fa322a0d7c'
AND (
token = 'yRX3v/un40wRvPYNhGh1A/l8jAXT+a27g0NbBtIpGrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)