UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lLNI+sve+kKQsg2Y2m3X7Fhy+e/yv5yucW/B55OBOJ0='
WHERE
key_id = 'b1b8b0cf8ef927579211ad29d6f75a8368ded66359958fdf7655efff75140a95'
AND (
token = 'lLNI+sve+kKQsg2Y2m3X7Fhy+e/yv5yucW/B55OBOJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)